#ifndef GLOBALSINGAL_H
#define GLOBALSINGAL_H

#include <QObject>
#include "module/module_header.h"
#include "module/module_window.h"

class GlobalSingal : public QObject
{
    Q_OBJECT
public:
    explicit GlobalSingal(QObject *parent = nullptr);

    void send_module_name_change(Module_Data *);

    void set_start_line(ModulePort *start);
    void set_end_line(ModulePort *end);
    void connect_line();
    void clean_line();

    bool if_connect_line = false;
    bool if_end_connect_line = true;

    ModulePort *start_port = nullptr;
    ModulePort *end_port = nullptr;

signals:
    void change_module_name(QString);
    void change_module_data(Module_Data *);

    void add_line(ModuleLine *line);

private:

};

extern GlobalSingal GSingal;

#endif // GLOBALSINGAL_H
